# Switch message languages in RSView Machine Edition 4.00

FactoryTalk View Machine Edition Version 5.00 and later supports language switching for local messages, information messages, and alarm messages.

Language switching in RSView Enterprise Machine Edition Version 4.00 did not include local messages, information messages, and alarm messages. When an application switched languages, these messages would still appear in the application's base language, that is, the language in which they were originally written.

Therefore, some users used an offset in the trigger value and an expression to display messages in different languages from a single message file.

## To show local, information, and alarm messages in multiple languages using the CurrentLanguage() function

1. Create a message file containing versions of all the messages in all the languages in the application. For local messages, this file is created in the Local Messages editor, for information messages, in the Information Messages editor, and for alarm messages, in the Messages tab of the Alarm Setup editor.
2. Assign trigger values to each of the messages, using a specific offset for each language. For example, if there are 10 English messages, these would be assigned the trigger values 1 to 10. These messages would be translated into the next language, French, for example, and the French messages would be assigned values with an offset of 100 from the English messages. You would then have an English message with a trigger value of 1 and the corresponding French message with a trigger value of 101, an English message with a trigger value of 2 and a corresponding French message with a trigger value of 102, and so on. Additional languages could be added, with, for example, translated German messages having trigger values of 301 to 310, Chinese having values of 401 to 410, and so on.
3. Create a tag with trigger values for each of the messages in the base language.
4. Create an expression in the message display object using the CurrentLanguage() function to detect what the current language is, and, based on what language is detected, to apply the appropriate offset to the tag being used to trigger the messages. For example:

   If CurrentLanguage() = "en-US" then tag1 else if CurrentLanguage() = "fr-FR" then tag1 + 100 else endif

5. At run time, the expression is evaluated. If the current language is English (United States), then the value of Tag1 would be used to trigger the English messages. If the operator presses a language switch button to make the current language French, the offset of 100 would be added to the value of Tag1 and would trigger messages in French.

If your RSView Machine Edition Version 4.0 application is using this method, you do not need to create new message files for each language when your application is opened in FactoryTalk Machine Edition Version 5.0 or later. By selecting a default language, you can continue to use your existing message file containing all the messages in multiple languages.

## See also

About language switching

Select a default language